package org.ch00.test00;

/*
 *
 *@author XCH
 *@date 2025 - 02 - 28
 *
 */
public class Phone {
    /**
     * 构造函数，用于初始化电话对象。
     *
     * @param brand     手机品牌
     * @param price     手机价格
     * @param name      手机名称
     * @param connection 联系人列表
     */
    private String brand;
    private double price;
    private String name;
    private String[] connection;
    public Phone() {
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String[] getConnection() {
        return connection;
    }

    public void setConnection(String[] connection) {
        this.connection = connection;
    }

    public void Internet(){
        System.out.println("上网");
    }
    public void Message(String connection, String message){
        boolean flag = true;
        for (String name : this.connection){
            if (name.equals(connection)){
                System.out.println("发送信息");
                flag = false;
                break;
            }
        }
    }
}
